package controller;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import pojo.Activity;
import pojo.Group;
import pojo.User;

import com.alibaba.fastjson.JSON;

import service.ActivityService;
import service.GroupService;

@Controller
public class IndexController {
	@Autowired
	@Qualifier("ActivityService")
	private ActivityService activityService;
	@Autowired
	@Qualifier("GroupService")
	private GroupService groupService;

	@RequestMapping(value = "/groups.do", produces = ("application/json;charset=utf-8"))
	@ResponseBody
	public String groups(HttpSession session) {
		List<Activity> listActivity = this.activityService.init();
		return JSON.toJSONString(listActivity);
	}
}
